package com.google.gwt.vector.client.ui;

import java.util.HashSet;
import java.util.Set;

import com.google.gwt.user.client.Element;
import com.google.gwt.vector.client.Vector;

public class Polyline extends BasicShape {

	private Set points = new HashSet();

	private Polyline(Element elem) {
		super(elem);
	}

	public Polyline() {
		this(Vector.createPolyline());
	    setColor(Color.BLACK);
	    setStrokeColor(Color.BLACK);
	    setStrokeWidth(1);
	}

	public void addPoint(double x, double y) {
		points.add(new Point(x, y));
		Vector.setPoints(getElement(), points);
	}

	public class Point {

		private double x;

		private double y;

		private Point() {
			super();
		}

		private Point(double x, double y) {
			this();
			this.x = x;
			this.y = y;
		}

		public double getX() {
			return x;
		}

		public double getY() {
			return y;
		}

	}


}
